

package com.oa.modules.sys.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.oa.common.validator.group.AddGroup;
import com.oa.common.validator.group.UpdateGroup;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 系统用户
 *
 * @author admin
 */
@Data
@TableName("sys_user")
public class SysUserEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    @TableId
    private Long userId;

    /**
     * 用户名
     */
    @NotBlank(message = "用户名不能为空", groups = {AddGroup.class, UpdateGroup.class})
    private String username;

    /**
     * 密码
     */
    @NotBlank(message = "密码不能为空", groups = AddGroup.class)
    private String password;

    /**
     * 盐
     */
    private String salt;

    /**
     * 邮箱
     */
//    @NotBlank(message = "邮箱不能为空", groups = {AddGroup.class, UpdateGroup.class})
//    @Email(message = "邮箱格式不正确", groups = {AddGroup.class, UpdateGroup.class})
    private String email;

    /**
     * 手机号
     */
    private String mobile;

    /**
     * 状态  0：禁用   1：正常
     */
    private Integer status;

    /**
     * 角色ID列表
     */
    @TableField(exist = false)
    private List<Long> roleIdList;

    /**
     * 角色名称列表
     */
    @TableField(exist = false)
    private List<SysRoleEntity> roleList;

    /**
     * 创建者ID
     */
    private Long createUserId;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 部门id
     */
    private String deptId;

    /**
     * 判断是否是审批人
     */
    private String auditStatus;

    /**
     * 用户id
     */
    @TableField(exist = false)
    private String[] userIds;

    /**
     * 手势密码
     */
    @TableField(exist = false)
    private String signPassword;

    /**
     * 名称
     */
    private String name;

    /**
     * 性别(0:女 1:男)
     */
    private String gender;

    /**
     * 别名
     */
    private String nickName;

    /**
     * 工作签名
     */
    private String signature;

    /**
     * 固定电话
     */
    private String telephone;

    /**
     * 头像路径
     */
    private String image;
    /**
     * 头像路径
     */
    private String imageHtmlUrl;
    /**
     * 过期时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date beOverdueTime;

    /**
     * 微信唯一标识
     */
    private String wxOpenId;

    /**
     * 微信头像地址
     */
    private String wxImageUrl;


    /**
     * 是否在通话中
     */
    private String isConversations;


    /**
     * 银行名称
     */
    @TableField(exist = false)
    private String bankName;

    @TableField(exist = false)
    private String socialType;
    /**
     * 用户对应的企业名称
     */
    @TableField(exist = false)
    private String company;


    @ApiModelProperty("机构id")
    @TableField(strategy = FieldStrategy.IGNORED)
    private Integer institutionId;

    @ApiModelProperty("所属联合体")
    @TableField(strategy = FieldStrategy.IGNORED)
    private Integer joint;

    @ApiModelProperty("是否发布过竞价项目")
    @TableField(exist = false)
    private Boolean isPushProject=false;

    private Integer roleId2;

    private String idCard;

    @ApiModelProperty(value="权限id")
    @TableField(exist = false)
    private Long roleId;

    @TableField(exist = false)
    private String keys;
}
